import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class PageAndroidview extends StatefulWidget {
  static const String routeName = "/PageAndroidview";

  const PageAndroidview();

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<PageAndroidview> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: AndroidView(
          viewType: 'plugins.nightfarmer.top/myview',
          //creationParams传入了一个map参数，并由原生组件接收
          creationParams: {
          "myContent": "来自flutter的map参数",
          },
          //creationParamsCodec传入的是一个编码对象这是固定写法。
          creationParamsCodec: const StandardMessageCodec(),
        ),
      ),
    );
  }

}
